package gildedrose;

/**
 * @author daiqing.chen
 */
public class BackstagePassesToATAFKAL80ETCConcert extends Item {

    public BackstagePassesToATAFKAL80ETCConcert(String name, int sellIn, int quality) {
        super(name, sellIn, quality);
    }

    @Override
    public void updateQuality() {
        if (quality < 50) {
            quality = quality + 1;
        }
        if (sellIn < 11) {
            if (quality < 50) {
                quality = quality + 1;
            }
        }

        if (sellIn < 6) {
            if (quality < 50) {
                quality = quality + 1;
            }
        }
        sellIn = sellIn - 1;
        if(sellIn < 0 ){
            quality = 0;
        }
    }
}
